# coding=utf-8
from main.models import Medicine
from main import db
from sqlalchemy.exc import InvalidRequestError
from main.BSL.medicineBSL import *
file1 = open("药品名称.txt")
file2=  open("药品禁忌.txt")

while True:

    title = file1.readline()  # 只读取一行内容
    content=file2.readline()
    # 判断是否读取到内容
    if not title or not content:
        break

    medicine = Medicine(title,content)
    insert(medicine)

file1.close()
file2.close()
